Minor warning cleanups.
static int wpt_a_ct;
static grid_type grid_index;
static int datum_index;
-static char* datum_str;
+static const char* datum_str;
static int current_line;
static char* date_time_format = NULL;
static int precision = 3;
/* helpers */
-static char*
-get_option_val(char* option, char* def)
+static const char*
+get_option_val(const char* option, const char* def)
{
- char* c = (option != NULL) ? option : def;
+ const char* c = (option != NULL) ? option : def;
return c;
}
static void
init_date_and_time_format(void)
{
- char* f, *c;
+ const char* f;
+ const char* c;
f = get_option_val(opt_date_format, DEFAULT_DATE_FORMAT);
date_time_format = convert_human_date_format(f);
f = get_option_val(opt_time_format, DEFAULT_TIME_FORMAT);
c = convert_human_time_format(f);
date_time_format = xstrappend(date_time_format, c);
- xfree(c);
+ xfree((void*) c);
}
static void
{
int idist;
double dist = *distance;
- char* unit;
+ const char* unit;
if (!gtxt_flags.metric) {
dist = METERS_TO_MILES(dist) * 1000.0;
gbfprintf(fout, "Waypoint\t%s\t", (wpt->shortname) ? wpt->shortname : "");
if (wpt_class <= gt_waypt_class_airport_ndb) {
- char* temp = wpt->notes;
+ const char* temp = wpt->notes;
if (temp == NULL) {
if (wpt->description && (strcmp(wpt->description, wpt->shortname) != 0)) {
temp = wpt->description;
static void
garmin_txt_wr_init(const char* fname)
{
- char* grid_str;
+ const char* grid_str;
memset(>xt_flags, 0, sizeof(gtxt_flags));
return gbfwrite(s, 1, strlen(s), file);
}
+// This is a depressing hack, meant to ease the pain from C strings
+// to QStrings, which are consitently encoded.
+int
+gbfputs(const QString& s, gbfile* file)
+{
+ const char* qs = s.toUtf8().data();
+ unsigned int l = strlen(qs);
+ return gbfwrite(qs, 1, l, file);
+}
+
/*
* gbfwrite: (as fwrite)
*/
#include <ctype.h>
#include <stdarg.h>
#include <string.h>
+#include <QtCore/QString.h>
+
#include "defs.h"
#include "cet.h"
int gbfprintf(gbfile* file, const char* format, ...);
int gbfputc(int c, gbfile* file);
int gbfputs(const char* s, gbfile* file);
+int gbfputs(const QString& s, gbfile* file);
int gbfwrite(const void* buf, const gbsize_t size, const gbsize_t members, gbfile* file);
int gbfflush(gbfile* file);
geo_wr_deinit(void)
{
writer.writeEndDocument();
- gbfputs(ostring.toUtf8().data(),ofd);
+ gbfputs(ostring,ofd);
gbfclose(ofd);
ofd = NULL;
}
*/
static
-char *ppdb_strcat(char *dest, const char *src, char *def, int *size)
+char *ppdb_strcat(char *dest, const char *src, const char *def, int *size)
{
int len;
char *res;
}
static
-char *str_pool_getcpy(const char *src, char *def)
+char *str_pool_getcpy(const char *src, const char *def)
{
char *res;